package tests;

import common.Utils;
import org.openqa.selenium.By;

/**
 * 测试未登陆的情况
 */


public class ListPage extends Utils {

    private static final String url = "http://110.41.148.165:13145/index.html"; //主页


    public ListPage() {
        super(url);
    }


    /**
     * 未登录访问列表页
     */
    public void listNoLogin() {
        driver.manage().window().maximize();
        //1.会直接跳转到登陆页面
        driver.findElement(By.cssSelector("body > div > div > div > div:nth-child(1) > div > div.card.card-md > div > h2"));

    }


    /**
     * 登陆后
     */
    public void listLogin() {
        driver.navigate().refresh();

        driver.findElement(By.cssSelector("#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post"));

        driver.findElement(By.cssSelector("#article_list_board_title"));

        //退出登陆
//        driver.findElement(By.cssSelector("#index_nav_avatar")).click();
//        driver.findElement(By.cssSelector("#index_user_logout > span")).click();
    }



}
